#include <iostream>

class Base
{
public:
    Base(int a) : a(a) {}
    void show()
    {
        std::cout << a << std::endl;
        std::cout << "Base" << std::endl;
    }

protected:
    int a;
};

class Base1 : virtual public Base
{
public:
    Base1(int a, int b) : Base(a), b(b) {}
    void show()
    {
        std::cout << a << std::endl;
        std::cout << "Base1" << std::endl;
    }

protected:
    int b;
};

class Base2 : virtual public Base
{
public:
    Base2(int a, int c) : Base(a), c(c) {}
    void show()
    {
        std::cout << a << std::endl;
        std::cout << "Base2" << std::endl;
    }

protected:
    int c;
};

class Derived : public Base1, public Base2
{
public:
    Derived(int a, int b, int c, int d) : Base(a), Base1(a, b), Base2(a, c), d(d)
    {
        this->a = a;
    }
    // void show()
    // {
    //     std::cout << a << std::endl;
    //     std::cout << "Derived" << std::endl;
    // }

protected:
    int d;
};

int main()
{
    Derived s(1, 2, 3, 4);
    s.show();
    return 0;
}
